﻿using Domain.Event;
using Domain.IRepositorys;
using Infrastructure.DomainEvent;
using Infrastructure.Error;
using Infrastructure.UniOfWorkBase;
using OtherLib.Getui;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Domain.Services
{
    public class MsgPulishService
    {

        public IEventDispatcher eventDispatcher { get; set; }
        public void SendMsg(int userID, string title, string msg,IDictionary<string,object> map=null)
        {
            eventDispatcher.SendApiEvent(new PushMsgEvent()
            {
                UserID = userID,
                Title = title,
                Message = msg,
                MsgData= map
            }).GetAwaiter().GetResult();
            
        }
    }
}
